//#pragma once
//#include "yzrutil.h"
//#include <shared_mutex>
//
//namespace yzrilyzr_util {
//	class Lock {
//	public:
//		virtual void lock() {}
//		virtual void unlock() {}
//	};
//	class ReentrantReadWriteLock {
//		class ReadLock  extends public Lock {
//		public:
//			ReentrantReadWriteLock* parent;
//			shared_lock<shared_mutex>* lock;
//			ReadLock(ReentrantReadWriteLock* parent) :parent(parent) {
//				//lock = new shared_lock<shared_mutex>(parent->mutex_, defer_lock_t);
//			}
//			void lock() override {
//				
//			}
//			void unlock()override {
//				delete lock;
//			}
//		};
//		class WriteLock  extends public Lock {
//		public:
//			ReentrantReadWriteLock* parent;
//			unique_lock<shared_mutex>* lock;
//			WriteLock(ReentrantReadWriteLock* parent) :parent(parent) {}
//			void lock() override {
//				//lock = new unique_lock<shared_mutex>(parent->mutex_);
//			}
//			void unlock()override {
//				delete lock;
//			}
//		};
//	private:
//		ReadLock* readerLock;
//		WriteLock* writerLock;
//		mutable shared_mutex mutex_;
//		//mutex mtx;
//	public:
//		ReentrantReadWriteLock() {
//			readerLock = new ReadLock(this);
//			writerLock = new WriteLock(this);
//		}
//		ReadLock* readLock() {
//			return readerLock;
//		}
//		WriteLock* writeLock() {
//			return writerLock;
//		}
//	};
//}